import {
	token
} from "@/utils/token.js"
export default {
	data() {
		return {

			rangeSex: [{
				value: 0,
				text: '男'
			}, {
				value: 1,
				text: '女'
			}],

			payChannelList: [
				"",
				"微信支付",
				"支付宝支付",
				"积分支付",
			],

			orderStatusList: [
				"未支付",
				"已支付",
				"已开盒",
				"已取消",
				"已申请发货",
				"已发货",
				"已签收",
				"已评价",
				"已完成",
				"已回收",
				"订单关闭",
			],


		}
	},
	onLoad(options) {
		//开启小程序分享
		// #ifdef MP-WEIXIN || MP-ALIPAY
		uni.showShareMenu({
			title: '24小时便民购药',
			path: options.path,
			withShareTicket: true,
			menus: ['shareAppMessage', 'shareTimeline']
		});
		// #endif

	},
	onShareAppMessage() {
		return {
			title: '24小时便民购药',
			// path: '/pages/index/index',
			success: res => {
				uni.showToast({
					title: '分享成功'
				});
			},
			fail: err => {
				uni.showToast({
					title: '分享失败',
					icon: 'none'
				});
			}
		};
	},

	methods: {

		isMobile(s) {
			return new RegExp(/^[1]([3-9])[0-9]{9}$/).test(s)
		},

		isIdCard(s) {
			return new RegExp(
				/^[1-9]\d{5}(18|19|20|(3\d))\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/).test(
				s)
		},


		//复制内容到剪切版
		setClipboardData(data) {
			uni.setClipboardData({
				data: data,
				success: res => {
					uni.showToast({
						title: '复制成功',
						icon: "none"
					});
				}
			});
		},


		//预览图片
		previewImage(imgs, index) {
			uni.previewImage({
				urls: imgs,
				loop: true,
				current: index
			});
		}




	}
}
